package main

import "fmt"

type Employee struct {
	name   string
	salary float64
}

func (r *Employee) giveRaise(proportion float64) float64 {
	return r.salary + (r.salary * proportion)
}

func main() {
	e1 := Employee{"张三", 5000}
	e2 := Employee{"李四", 9500}

	fmt.Printf("%s 的工资涨幅20%% , 当前工资 %f  涨幅后 %f\n", e1.name, e1.salary, e1.giveRaise(0.2))
	fmt.Printf("%s 的工资涨幅10%% , 当前工资 %f  涨幅后 %f\n", e2.name, e2.salary, e2.giveRaise(0.1))
}
